<?php
/**
 * Created by zengxianfen on 2020/7/17 11:28.
 */

namespace App\Model\Repository;


use Hyperf\Database\Model\Model;

class BaseRepository
{
    /**
     * @var Model
     */
    protected $model = null;

    /**
     * @return Model
     */
    public function getModel(): Model
    {
        return $this->model;
    }

    /**
     * @param Model $model
     */
    public function setModel(Model $model): void
    {
        $this->model = $model;
    }

    public function create(array $array)
    {
        return $this->model::create($array);
    }


    public function find($id) {
        return $this->model::find($id);
    }

}